<%@ Page Language="C#" MasterPageFile="~/admin/Admin.master" ValidateRequest="false" AutoEventWireup="true" CodeFile="options.aspx.cs" Inherits="admin_Pages_configuration" Title="Settings" %>

<asp:Content ID="Content1" ContentPlaceHolderID="body" runat="Server">

    <script type="text/javascript">
      function PreviewTheme()
      {
        var theme = document.getElementById('<%=ddlTheme.ClientID %>').value;
        var path = '../../?theme=' + theme;
        window.open(path);
      }
    </script>

    <br />
    <div style="text-align: right">
        <asp:Button runat="server" ID="btnSaveTop" />
    </div>
    <br />
    <div class="settings">
        <h1><%$ Resources: lables, basic %> <%$ Resources: lables, settings.ToLowerInvariant() %></h1>
        <label for="<%=txtName.ClientID %>"><%$ Resources: lables, name %></label>
        <asp:TextBox runat="server" ID="txtName" Width="300" />
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtName" ErrorMessage="Required" /><br />
        
        <label for="<%=txtDescription.ClientID %>"><%$ Resources: lables, description %></label>
        <asp:TextBox runat="server" ID="txtDescription" Width="300" /><br />
        
        <label for="<%=txtPostsPerPage.ClientID %>"><%$ Resources: lables, postPerPage %></label>
        <asp:TextBox runat="server" ID="txtPostsPerPage" Width="50" MaxLength="4" />
        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtPostsPerPage" ErrorMessage="Required" />
        <asp:CompareValidator runat="server" ControlToValidate="txtPostsPerPage" Operator="DataTypeCheck" Type="integer" ErrorMessage="Please enter a valid number" /><br />
        
        <label for="<%=ddlTheme.ClientID %>"><%$ Resources: lables, theme %></label>
        <asp:DropDownList runat="server" ID="ddlTheme" />
        <a href="javascript:void(PreviewTheme());">Preview</a> | 
        <a href="http://www.dotnetblogengine.net/page/themes.aspx" target="_blank">Download</a><br />
        
        <label for="<%=ddlMobileTheme.ClientID %>"><%$ Resources: lables, mobileTheme %></label>
        <asp:DropDownList runat="server" ID="ddlMobileTheme" /><br />
        
        <label for="<%=cbShowRelatedPosts.ClientID %>"><%$ Resources: lables, showRelatedPosts %></label>
        <asp:CheckBox runat="server" ID="cbShowRelatedPosts" /><br />
        
        <label for="<%=cbEnableRating.ClientID %>"><%$ Resources: lables, enableRating %></label>
        <asp:CheckBox runat="server" ID="cbEnableRating" /><br />
        
        <label for="<%=cbShowDescriptionInPostList.ClientID %>"><%$ Resources: lables, showDescriptionInPostList %></label>
        <asp:CheckBox runat="server" ID="cbShowDescriptionInPostList" /><br />
        
        <label for="<%=cbTimeStampPostLinks.ClientID %>"><%$ Resources: lables, timeStampPostLinks %></label>
        <asp:CheckBox runat="server" ID="cbTimeStampPostLinks" /><br />
        
        <label for="<%=cbShowPostNavigation.ClientID %>"><%$ Resources: lables, showPostNavigation %></label>
        <asp:CheckBox runat="server" ID="cbShowPostNavigation" /><br />
        
        <label for="<%=ddlCulture.ClientID %>"><%$ Resources: lables, language %></label>
        <asp:DropDownList runat="Server" ID="ddlCulture" Style="text-transform: capitalize">
            <asp:ListItem Text="Auto" />
            <asp:ListItem Text="english" Value="en" />
        </asp:DropDownList><br />
        
        <label for="<%=txtTimeZone.ClientID %>"><%$ Resources: lables, timezone %></label>
        <asp:TextBox runat="Server" ID="txtTimeZone" Width="30" /> Server time: <%=DateTime.Now.ToShortTimeString() %>
        <asp:CompareValidator runat="server" ControlToValidate="txtTimeZone" Operator="dataTypeCheck" Type="double" Display="dynamic" ErrorMessage="Please specify a valid number (positive or negative)" />
        
    </div>
    
    <div class="settings">
        <h1><%$ Resources: lables, advancedSettings %></h1>
        
        <label for="<%=cbEnableCompression.ClientID %>"><%$ Resources: lables, enableHttpCompression %></label>
        <asp:CheckBox runat="server" ID="cbEnableCompression" /><%$ Resources: lables, enableHttpCompressionDescription %><br />
        
        <label for="<%=cbRemoveWhitespaceInStyleSheets.ClientID %>"><%$ Resources: lables, trimStylesheet %></label>
        <asp:CheckBox runat="server" ID="cbRemoveWhitespaceInStyleSheets" /><%$ Resources: lables, trimStylesheetDescription %><br />
        
        <label for="<%=cbEnableOpenSearch.ClientID %>"><%$ Resources: lables, enableOpenSearch %></label>
        <asp:CheckBox runat="server" ID="cbEnableOpenSearch" /><%$ Resources: lables, enableOpenSearchDescription %><br />
        
        <label for=""><%$ Resources: lables, enableTrackbacks %></label>
        <asp:CheckBox runat="server" ID="cbEnableTrackBackSend" /><%$ Resources: lables, send %> &nbsp;&nbsp;
        <asp:CheckBox runat="server" ID="cbEnableTrackBackReceive" /><%$ Resources: lables, receive %><br />
        
        <label for=""><%$ Resources: lables, enablePingbacks %></label>
        <asp:CheckBox runat="server" ID="cbEnablePingBackSend" /><%$ Resources: lables, send %> &nbsp;&nbsp;
        <asp:CheckBox runat="server" ID="cbEnablePingBackReceive" /><%$ Resources: lables, receive %><br />
        
        <label for="<%=rblWwwSubdomain.ClientID %>"><%$ Resources: lables, handleWwwSubdomain %></label>
        <asp:RadioButtonList runat="server" ID="rblWwwSubdomain" RepeatLayout="flow" RepeatDirection="horizontal">
            <asp:ListItem Text="<%$ Resources:labels, remove %>" Value="remove" />
            <asp:ListItem Text="<%$ Resources:labels, enforce %>" Value="add" />
            <asp:ListItem Text="<%$ Resources:labels, ignore %>" Value="" Selected="true" />
        </asp:RadioButtonList>
    </div>
    
    <div class="settings">
        <h1><%$ Resources: lables, comments %></h1>
        
        <label for="<%=cbEnableComments.ClientID %>"><%$ Resources: lables, enableComments %></label>
        <asp:CheckBox runat="server" ID="cbEnableComments" /><%$ Resources: lables, enableCommentsDescription %><br />
        
        <label for="<%=cbEnableCountryInComments.ClientID %>"><%$ Resources: lables, showCountryChooser %></label>
        <asp:CheckBox runat="server" ID="cbEnableCountryInComments" /><%$ Resources: lables, showCountryChooserDescription %><br />
        
        <label for="<%=cbEnableCoComment.ClientID %>"><%$ Resources: lables, enableCoComments %></label>
        <asp:CheckBox runat="server" ID="cbEnableCoComment" /><br />
        
        <label for="<%=cbShowLivePreview.ClientID %>"><%$ Resources: lables, showLivePreview %></label>
        <asp:CheckBox runat="server" ID="cbShowLivePreview" /><br />
        
        <label for="<%=rblAvatar.ClientID %>"><%$ Resources: lables, avatars %></label>
        <asp:RadioButtonList runat="Server" ID="rblAvatar" RepeatLayout="flow" RepeatDirection="horizontal">
          <asp:ListItem Text="Gravatar" Value="gravatar" />
          <asp:ListItem Text="<%$ Resources:labels, monster %>" Value="monster" />
          <asp:ListItem Text="<%$ Resources:labels, combine %>" Value="combine" />
          <asp:ListItem Text="<%$ Resources:labels, none %>" Value="none" />
        </asp:RadioButtonList><br />
        
        <label for="<%=cbEnableCommentsModeration.ClientID %>"><%$ Resources: lables, enableCommentsModeration%></label>
        <asp:CheckBox runat="server" ID="cbEnableCommentsModeration" /><br />
        
        <label for="<%=ddlCloseComments.ClientID %>" style="position: relative; top: 4px">
            <%$ Resources: lables, closeCommetsAfter %>
        </label>
        <asp:DropDownList runat="server" ID="ddlCloseComments">
            <asp:ListItem Text="Never" Value="0" />
            <asp:ListItem Text="1" />
            <asp:ListItem Text="2" />
            <asp:ListItem Text="3" />
            <asp:ListItem Text="7" />
            <asp:ListItem Text="10" />
            <asp:ListItem Text="14" />
            <asp:ListItem Text="21" />
            <asp:ListItem Text="30" />
            <asp:ListItem Text="60" />
            <asp:ListItem Text="90" />
        </asp:DropDownList>
        days.
    </div>
    <div class="settings">
        <h1>E-mail</h1>
        
        <label for="<%=txtEmail.ClientID %>"><%$ Resources: lables, emailAddress %></label>
        <asp:TextBox runat="server" ID="txtEmail" Width="300" /><br />
        
        <label for="<%=txtSmtpServer.ClientID %>">SMTP server</label>
        <asp:TextBox runat="server" ID="txtSmtpServer" Width="300" /><br />
        
        <label for="<%=txtSmtpServerPort.ClientID %>"><%$ Resources: lables, portNumber %></label>
        <asp:TextBox runat="server" ID="txtSmtpServerPort" Width="35" /> <%$ Resources: lables, portNumberDescription %>
        <asp:CompareValidator ID="CompareValidator2" runat="Server" ControlToValidate="txtSmtpServerPort" Operator="datatypecheck" Type="integer" ErrorMessage="Not a valid number" /><br />
        
        <label for="<%=txtSmtpUsername.ClientID %>"><%$ Resources: lables, userName %></label>
        <asp:TextBox runat="server" ID="txtSmtpUsername" Width="300" /><br />
        
        <label for="<%=txtSmtpPassword.ClientID %>"><%$ Resources: lables, password %></label>
        <asp:TextBox runat="server" ID="txtSmtpPassword" Width="300" /><br />
        
        <label for="<%=cbEnableSsl.ClientID %>"><%$ Resources: lables, enableSsl%></label>
        <asp:CheckBox runat="Server" ID="cbEnableSsl" /><br />
        
        <label for="<%=cbComments.ClientID %>"><%$ Resources: lables, sendCommentEmail %></label>
        <asp:CheckBox runat="Server" ID="cbComments" /><br />
        
        <label for="<%=txtEmailSubjectPrefix.ClientID %>"><%$ Resources: lables, emailSubjectPrefix %></label>
        <asp:TextBox runat="server" ID="txtEmailSubjectPrefix" Width="300" /><br /><br />
        
        <asp:Button runat="server" CausesValidation="False" ID="btnTestSmtp" Text="Test mail settings" />
        <asp:Label runat="Server" ID="lbSmtpStatus" />
    </div>
    <div class="settings">
        <h1>Feed <%$ Resources: lables, settings.ToLowerInvariant() %>
        </h1>
        <label for="<%=ddlSyndicationFormat.ClientID %>" style="position: relative; top: 4px"><%$ Resources: lables, defaultFeedOutput %></label>
        <asp:DropDownList runat="server" ID="ddlSyndicationFormat">
            <asp:ListItem Text="RSS 2.0" Value="Rss" Selected="True" />
            <asp:ListItem Text="Atom 1.0" Value="Atom" />
        </asp:DropDownList>
        format.<br /><br />
        
        <label for="<%=txtPostsPerFeed.ClientID %>"><%$ Resources: lables, postsPerFeed %></label>
        <asp:TextBox runat="server" ID="txtPostsPerFeed" Width="50" MaxLength="4" />
        <asp:RequiredFieldValidator runat="server" ControlToValidate="txtPostsPerFeed" ErrorMessage="Required" />
        <asp:CompareValidator runat="server" ControlToValidate="txtPostsPerPage" Operator="DataTypeCheck" Type="integer" ErrorMessage="Please enter a valid number" /><br />
        
        <label for="<%=txtDublinCoreCreator.ClientID %>"><%$ Resources: lables, author %></label>
        <asp:TextBox runat="server" ID="txtDublinCoreCreator" Width="300" /><br />
        
        <label for="<%=txtDublinCoreLanguage.ClientID %>"><%$ Resources: lables, languageCode %></label>
        <asp:TextBox runat="server" ID="txtDublinCoreLanguage" Width="60" /><br /><br />
        
        <label for="<%=txtGeocodingLatitude.ClientID %>"><%$ Resources: lables, latitude %></label>
        <asp:TextBox runat="server" ID="txtGeocodingLatitude" Width="300" /><br />
        
        <label for="<%=txtGeocodingLongitude.ClientID %>"><%$ Resources: lables, longtitude %></label>
        <asp:TextBox runat="server" ID="txtGeocodingLongitude" Width="300" /><br /><br />
        
        <label for="<%=txtBlogChannelBLink.ClientID %>"><%$ Resources: lables, endorsment %></label>
        <asp:TextBox runat="server" ID="txtBlogChannelBLink" MaxLength="255" Width="300" /><br />
        
        <label for="<%=txtAlternateFeedUrl.ClientID %>"><%$ Resources: lables, alternateFeedUrl %></label>
        <asp:TextBox runat="server" ID="txtAlternateFeedUrl"  Width="300" /> <em>(http://feeds.feedburner.com/username)</em>
        <asp:RegularExpressionValidator runat="Server" ControlToValidate="txtAlternateFeedUrl" ValidationExpression="(http://|https://|)([\w-]+\.)+[\w-]+(/[\w- ./?%&=;~]*)?" ErrorMessage="Please enter a valid URL" Display="Dynamic" />
    </div>
    <div class="settings">
        <h1>
            <%$ Resources: lables, htmlHeadSection %>
        </h1>
        <label for="<%=txtHtmlHeader.ClientID %>">
            <%$ Resources: lables, addCustomCodeToHeader %>
        </label>
        <asp:TextBox runat="server" ID="txtHtmlHeader" TextMode="multiLine" Rows="9" Columns="30"
            Width="500" />
    </div>
    <div class="settings">
        <h1>Tracking script</h1>
        <label for="<%=txtTrackingScript.ClientID %>">
          Visitor tracking script<br /><br />The JavaScript code from i.e. Google Analytics.<br /><br />
          Will be added in the bottom of each page regardless of the theme.<br /><br />(remember to add the &lt;script&gt; tags)</label>
        <asp:TextBox runat="server" ID="txtTrackingScript" TextMode="multiLine" Rows="9" Columns="30" Width="500" />
    </div>
    
    <div class="settings">
		<h1>URL Handling</h1>
		<p><label for="<%= blogUrl %>">Blog URL:</label><asp:TextBox ID="blogUrl" runat="server" Width="300px" /></p>
    
		<h1>Permalink Structure</h1>
		<p><asp:RadioButton ID="defaultPermalink" runat="server" GroupName="Permalinks" />Default<br />
		<label>Permalink Example: </label><em>http://somesite.com/post/<%= DateTime.Now.Year %>/<%= DateTime.Now.Month %>/sample-post.aspx</em></p>
		
		<p><asp:RadioButton ID="customPermalink" runat="server" GroupName="Permalinks" />Custom, enter below<br />
		<label for="<%=customPermalinkText.ClientID %>">Custom Permalink: </label><asp:TextBox ID="customPermalinkText" runat="server" Text="/post/%year%/&monthnum&/%postname%.aspx" Width="300px" /><asp:RegularExpressionValidator ID="customPermalinkValidator" runat="server" ControlToValidate="customPermalinkText" Display="Dynamic" ErrorMessage="Your custom permalink must end in '.aspx' because of limitations in the version of IIS you are using." ValidationExpression="[a-zA-Z0-9\-%/]+[a-zA-Z0-9%].aspx" /></p>
    
		<h1>Optional</h1>
		<p><label for="<%= categoryBase.ClientID %>">Term Base:</label><asp:TextBox ID="categoryBase" runat="server" Width="300px" /></p>
		<p><label for="<%= tagBase.ClientID %>">Tag Base:</label><asp:TextBox ID="tagBase" runat="server" Width="300px" /></p>
		<p><label for="<%= pageBase.ClientID %>">Page Base:</label><asp:TextBox ID="pageBase" runat="server" Width="300px" /></p>
		<p><label for="<%= authorBase.ClientID %>">Author Base:</label><asp:TextBox ID="authorBase" runat="server" Width="300px" /></p>
    </div>
    
    <div class="settings">
      <h1><%$ Resources: lables, import %> & <%$ Resources: lables, export %></h1>
      <p>
        <%$ Resources: lables, blogMLDescription %>
        (<a href="http://blogml.org/">blogml.org</a>)
      </p>
      <input type="button" value="<%$ Resources: lables, import %>" onclick="location.href='http://dotnetblogengine.net/clickonce/blogimporter/blog.importer.application?url=<%=Utils.AbsoluteWebRoot %>&username=<%=Page.User.Identity.Name %>'" />&nbsp;&nbsp;
      <input type="button" value="<%$ Resources: lables, export %>" onclick="location.href='blogml.axd'" />
    </div>
    
    <div align="right">
        <asp:Button runat="server" ID="btnSave" /></div>
    <br />
</asp:Content>